  <?php 
  $repository=BO::getProductBORepository();
  $id=getFormValue('id');
  $productBO = $repository->getProductBO($id);	?>
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">Product : <?php echo $productBO->getName() ?></div>
  <div class="panel-body">
		<p>
		
		</p>	

	  	
		<ul class="nav nav-tabs" role="tablist">
		  <li><a href="dispatch.php?target=product-edit&id=<?php echo $productBO->getID() ?>">General</a></li>
		  <li><a href="dispatch.php?target=product_attribute-edit&id=<?php echo $productBO->getID() ?>">Attributes</a></li>
		  <li><a href="dispatch.php?target=product_images-edit&id=<?php echo $productBO->getID() ?>">Images</a></li>
		  <li class="active"><a href="dispatch.php?target=product_pricing-edit&id=<?php echo $productBO->getID() ?>">Pricing</a></li>
		  <li><a href="dispatch.php?target=product_promotions-edit&id=<?php echo $productBO->getID() ?>">Promotions</a></li>
		  <li><a href="dispatch.php?target=product_categories-edit&id=<?php echo $productBO->getID() ?>">Categories</a></li>
		  <li><a href="dispatch.php?target=product_variations-edit&id=<?php echo $productBO->getID() ?>">Variations</a></li>
		</ul>
		<div class="panel">	
			<div class="panel-body">
			<div class="bs-example">
				<h1>Product :Pricing</h1>
					<form class="form-horizontal" action="dispatch.php" method="post" >
						<input type="hidden" name="target" value="product_pricing-save">
						<input type="hidden" name="id" value="<?php echo $productBO->getID() ?>">						
						<div class="form-group">
							<label class="col-xs-1" for="inputview">Price Type:</label>
							<div class="col-xs-2">
								<select name="type">
									<option value="SalePrice">SalePrice</option>
									<option value="CostPrice">CostPrice</option>
									<option value="DiscountedPrice">DiscountedPrice</option>
									<option value="ListPrice">ListPrice</option>
								</select>
							</div>
							<label class="col-xs-2" for="inputview">Price:</label>
							<div class="col-xs-3">
								<input type="input" name="price"  class="form-control" id="inputName" placeholder="Attribute Name">
							</div>
							
							<div class="col-xs-2">
								<input type="submit" class="btn btn-primary" value="Submit">
							</div>
						</div>
					</form>
					<div class="table-responsive">
					<table class="table table-striped">
					  <thead>
						<tr>
						  <th>Price type</th>
						  <th>Price Value</th>
						  <th>Action</th>
						</tr>
					  </thead>
					  <tbody>
						<?php 
							$prices = $productBO->getPrices(); 
							foreach($prices as $k => $price)
							{
						?>
						<tr>
						  <td><?php echo $price->type;?></td>
						  <td><?php echo $price->price;?></td>
						  <td>
							<div class="btn-group">	
								<a href="dispatch.php?target=product_pricing-delete&id=<?php echo $productBO->getID()?>&priceid=<?php echo $price->id?>"  class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></a>						  
							</div>
						  </td>	
						</tr>
						<?php	
							}
						?>
					  </tbody>
					</table>
				</div>
				</div>
			</div>
		</div>
		
		
		
	</div>
	
	 <div class="panel-footer">
		<div class="btn-group">
			<form action="dispatch.php" method="post">
				<button type="submit" name="target" value="product-add" class="btn btn-default btn-lg">
					<span class="glyphicon glyphicon-plus"></span> New Product
				</button>
			</form>
		</div>
	</div>	
</div>	
		  
		  
		  
